package com.dragon.web.ykd.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.dragon.app.ykd.service.BurialPointAppService;
import com.fintech.common.constant.ErrorCode;
import com.fintech.common.vo.FintechResult;
import com.marvels.common.utils.MarvelsLogUtil;

/**
 * 埋点数据
 * 
 * @author tux
 *
 */
@Controller
@RequestMapping("${platform.name.code}/burialpoint")
public class BurialPointController {
	@Autowired
	private BurialPointAppService burialPointAppService;

	/**
	 * 记录通话记录
	 * 
	 * @param map
	 * @param accessToken
	 * @param idFintechUmUser
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/addCallRecords")
	public FintechResult addCallRecords(@RequestBody Map<String, Object> map, @RequestHeader String accessToken,
			@RequestHeader String idFintechUmUser) {
		MarvelsLogUtil.getInstance().info("===============addCallRecords is begine===============,参数="+JSON.toJSONString(map));
		if(map == null) {
			return FintechResult.getResult(ErrorCode.FAIL, "信息不完整", null);
		}
		return burialPointAppService.addCallRecords(map, accessToken, idFintechUmUser);
	}

	/**
	 * 记录短信记录
	 * 
	 * @param map
	 * @param accessToken
	 * @param idFintechUmUser
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/addMsgRecords")
	public FintechResult addMsgRecords(@RequestBody Map<String, Object> map, @RequestHeader String accessToken,
			@RequestHeader String idFintechUmUser) {
		MarvelsLogUtil.getInstance().info("===============addMsgRecords is begine===============");
		return burialPointAppService.addMsgRecords(map, accessToken, idFintechUmUser);
				
	}
}
